<%-- 
    Document   : scheduleList
    Created on : Aug 10, 2014, 6:05:18 PM
    Author     : cjayawickrema
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<table>
    <thead>
        <tr>
            <th>Schedule Id.</th>
            <th>Ship No.</th>
            <th>Ship Name</th>
            <th colspan="2">Departure</th>
            <th colspan="2">Arrival</th>
            <th>Status</th>
            <th>Distance (km)</th>
            <th>Book</th>
        </tr>
    </thead>
    <c:forEach var="item" items="${schedule}">
        <tr>
            <td>${item.id}</td>
            <td>${item.ship.id}</td>
            <td>${item.ship.name}</td>
            <td>${item.departurePort}</td>
            <td>2014/04/20</td>
            <td>${item.arrivalPort}</td>
            <td>2014/04/20</td>
            <td>${item.status}</td>
            <td>${item.distance}</td>
            <td>
                <form method="post" action="declareShipment">
                    <input type="hidden" name="shipmentRef" value="${item.id}" />
                    <input type="submit" value="Book Now"/>
                </form>
            </td>
        </tr>
    </c:forEach>
</table>
